package org.example.demo3.demos.web.service.translate.impl;

import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import org.example.demo3.demos.web.service.translate.TranslateService;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class DateTranslate implements TranslateService {
    @Override
    public String translate(String dictType,String code, String format, String value) {
        if (StringUtils.isBlank(value) || "null".equals(value)) {
            return "";
        }
        return DateUtil.format(new Date(Long.parseLong(value)),format);
    }
}
